package com.micro.ai.files.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 存储配额实体类
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@TableName("storage_quotas")
@Schema(description = "存储配额信息")
public class StorageQuota implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "配额ID", example = "quota_123456789")
    private String id;

    /**
     * 租户ID
     */
    @Schema(description = "租户ID", example = "tenant_001")
    private String tenantId;

    /**
     * 总配额（字节），默认5GB
     */
    @Schema(description = "总配额（字节）", example = "5368709120")
    private Long totalQuota;

    /**
     * 已使用存储（字节）
     */
    @Schema(description = "已使用存储（字节）", example = "1073741824")
    private Long usedStorage;

    /**
     * 回收站占用空间（字节）
     */
    @Schema(description = "回收站占用空间（字节）", example = "104857600")
    private Long usedTrashStorage;

    /**
     * 文件数量
     */
    @Schema(description = "文件数量", example = "100")
    private Integer fileCount;

    /**
     * 单文件最大大小（字节），默认1GB
     */
    @Schema(description = "单文件最大大小（字节）", example = "1073741824")
    private Long maxFileSize;

    /**
     * 警告阈值百分比
     */
    @Schema(description = "警告阈值百分比", example = "90")
    private Integer warningThreshold;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间", example = "2025-01-01 00:00:00")
    private LocalDateTime updatedAt;
}

